<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Chap0 - Microblog</title>
    <link rel='stylesheet' href='<?php echo $_static_?>/bo/css/bootstrap.css' />
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>
    <link href="<?php echo $_static_?>/bo/css/bootstrap-responsive.css" rel="stylesheet">
  </head>
  <body>
  <?php
  $success = Dao::flash('success');
  $error = Dao::flash('error');
  $user = User::current_user();
  ?>
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="<?php echo url(ROUTE_HTML_APP, url_params('chap0','index'));?>">Microblog</a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="<?php echo url(ROUTE_HTML_APP, url_params('chap0','index'));?>">首頁</a></li>
              
              <?php if (!$user) { ?>
                <li><a href="<?php echo url(ROUTE_HTML_APP, url_sfparams('chap0','login'));?>">登录</a></li>
                <li><a href="<?php echo url(ROUTE_HTML_APP, url_sfparams('chap0','reg'));?>">注册</a></li>
              <?php } else { ?>
                <li><a href="<?php echo url(ROUTE_JSON_APP, url_sfparams('chap0','logout'));?>">注销</a></li>
              <?php } ?>
            </ul>
          </div>
        </div>
      </div>
    </div>
    
    <div id="container" class="container">
      <?php if ($success) { ?>
        <div class="alert alert-success">
          <?php echo $success ?>
        </div>
      <?php } ?>
      <?php if ($error) { ?>
        <div class="alert alert-error">
          <?php echo $error ?>
        </div>
      <?php } ?>
      
      <?php $this->block('body');?> <h2> body </h2> <?php $this->endblock();?>
      <hr />
      <footer>
        <p><a href="https://git.oschina.net/eemcmc/redis.imooc.php.git" target="_blank">redis.imooc.php</a> 2015</p>
      </footer>
    </div>
  </body>
  <script src="<?php echo $_static_?>/bo/js/jquery.js"></script>
  <script src="<?php echo $_static_?>/bo/js/bootstrap.js"></script>
</html>
